Move webpack implementation into package folder#94129
Draft
timneutkens wants to merge 9 commits into
Draft
Conversation
Contributor
Stats cancelledCommit: 765108e |
Contributor
Failing test suitesCommit: 765108e | About building and testing Next.js
Expand output● instant-navigation-testing-api › renders runtime-prefetched content instantly during navigation
Expand output● hmr-intercept-routes › should update intercept routes via HMR
Expand output● instant-navigation-testing-api › renders runtime-prefetched content instantly during navigation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Move the webpack implementation into
packages/next/src/webpackinside thenextpackage, with lazy Next core integration for webpack/rspack paths. Keep shared Babel and Sass compatibility code in neutral core build locations, includingresolve-url-loaderunderpackages/next/src/build/resolve-url-loader.Why?
Webpack is now opt-in, and keeping its implementation in a dedicated folder makes the support code easier to remove cleanly in the future while preserving
next --webpackandconfig.webpackbehavior.How?
Relocated webpack build/dev/loaders/plugins/vendor files under
src/webpack, addednext/dist/webpack/next-integrationas the internal lazy integration entry, moved shared manifest/trace/dev-page types to neutral core modules, updated Next-owned tests/scripts/storybook references, and adjusted package build output so webpack files compile todist/webpack. Generated webpack bundles and compiled webpack vendor files are ignored at their new paths.Verification
pnpm --filter=next buildpnpm --filter=next typespnpm pack-next --no-js-build --tarNEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-webpack test/e2e/webpack-require-hook/webpack-require-hook.test.tsNEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-webpack test/production/webpack-config-mainjs/webpack-config-mainjs.test.tsNEXT_TEST_PREFER_OFFLINE=1 pnpm test-start-rspack test/e2e/hello-world/hello-world.test.tsNEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-turbo test/e2e/app-dir/scss/basic-module/basic-module.test.tsNEXT_TEST_PREFER_OFFLINE=1 pnpm test-dev-webpack test/e2e/app-dir/scss/basic-module/basic-module.test.tspnpm jest test/unit/next-babel-loader-dev.test.ts test/unit/next-babel-loader-prod.test.tslint-staged